package cn.com.sise.service.impl;

import cn.com.sise.dao.AssistanceDao;
import cn.com.sise.pojo.Assistance;
import cn.com.sise.service.AssistanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AssistanceServiceImpl implements AssistanceService {
    private AssistanceDao assistanceDao;

    @Autowired
    public void setAssistanceDao(AssistanceDao assistanceDao) {
        this.assistanceDao = assistanceDao;
    }

    //    增加帮助信息
    public int insertAssistance(Assistance assistance) {
        return assistanceDao.insertAssistance(assistance);
    }

    //    通过situation模糊查询帮助信息
    public int updateAssistance(Assistance assistance) {
        return assistanceDao.updateAssistance(assistance);
    }

    //    通过situation模糊查询帮助信息
    public List<Assistance> selectAssistance(Assistance assistance) {
        return assistanceDao.selectAssistance(assistance);
    }

    public List<Assistance> getClassificationDis(int start, int count) {
        return assistanceDao.getClassificationDis(start, count);
    }

    public int getClassificationDisTotal() {
        return assistanceDao.getClassificationDisTotal();
    }

    public void deleteForClass(Assistance assistance) {
        assistanceDao.deleteForClass(assistance);
    }

    public void deleteByHelpId(Assistance assistance) {
        assistanceDao.deleteByHelpId(assistance);
    }

    public Assistance getAssistanceById(int helpId) {
        return assistanceDao.getAssistanceById(helpId);
    }

    public List<Assistance> getAllAssistance() {
        return assistanceDao.getAllAssistance();
    }
}
